package com.yuhs.zixing.study.design.pattern.dp002.structural.s002.bridge.b003;

/**
 * @description:
 * @author: yuhs
 * @date: 2022/5/1 6:15 PM
 */
public abstract class Abstraction {
    //定义对实现化角色的引用
    private Implementor imp;

    //约束子类必须实现该构造函数
    public Abstraction(Implementor _imp) {
        this.imp = _imp;
    }

    //自身的行为和属性
    public void request() {
        this.imp.doSomething();
    }

    //获得实现化角色
    public Implementor getImp() {
        return imp;
    }
}
